package com.deep.hystrix.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// 默认不启用回调，需要手动配置开启
@FeignClient(value = "cloud-provider", fallback = ProviderClientCallback.class)
// 默认没有失败回调
//@FeignClient(value = "cloud-provider")
public interface ProviderClient {

    @GetMapping("/provider/{name}")
    public String echo(@PathVariable(name = "name") String name);

    @GetMapping("/provider/error")
    public String error();

    @GetMapping("/provider/timeout")
    public String timeout();
}
